<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #tank {
            position: absolute;
            left: 100px;
            top: 100px;
            width: 100px;
            height: 100px;
            border-radius: 50px;
            background: #67ddd9;
        }
    </style>
</head>
<body>
<div id="tank"></div>
</body>
</html>
<script>
    let divLeft = 0;
    let divTop = 0;
    onload = function () {
        let obj = document.getElementById('tank')
        obj.style.top = divTop + 'px'
        obj.style.left = divLeft + 'px'
    }
    onkeydown = function (e) {
        let obj = document.getElementById('tank')
        console.log(obj.style.top)
        switch (e.key) {
            case 'ArrowUp':
                divTop = divTop - 10;
                obj.style.top = divTop + 'px';
                break;
            case 'ArrowDown':
                divTop = divTop + 10;
                obj.style.top = divTop + 'px';
                break;
            case 'ArrowLeft':
                divLeft = divLeft - 10;
                obj.style.left = divLeft + 'px';
                break;
            case 'ArrowRight':
                divLeft = divLeft + 10;
                obj.style.left = divLeft + 'px';
                break;
        }
    }
</script>